package com.vhall.component.entity.dictionary.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author shimingming
 * @since 2023/4/13 19:48
 */
@Getter
@AllArgsConstructor
public enum ColumnLevelEnum implements BaseEnum {

    HEADQUARTERS_BOUTIQUE(1, "总部精品"),
    HEADQUARTERS_ORDINARY(2, "总部普通"),
    BRANCH_BOUTIQUE(3, "分支精品"),
    BRANCH_NORMAL(4, "分支普通"),


    ;

    private Integer value;

    private String name;

    public static String getName(Integer value) {
        for (ColumnLevelEnum anEnum : ColumnLevelEnum.values()) {
            if (anEnum.getValue().equals(value)) {
                return anEnum.name;
            }
        }
        return null;
    }

    public static ColumnLevelEnum parse(Integer value) {
        for (ColumnLevelEnum type : ColumnLevelEnum.values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return null;
    }
}
